#include <bits/stdc++.h>

using namespace std;

const int N = 1e7 + 10;
int arr[N];
int n , x;

int main()
{
    cin >> n >> x;
    for(int i = 1;i <= n;i ++) cin >> arr[i];

    int left = 0 , right = 0 , sum = 0;
    int retlen = N , retleft = -1 , retright = -1;

    while(right <= n)
    {
        sum += arr[right];
        while(sum >= x)
        {
            if(right - left + 1 < retlen)
            {
                retleft = left;
                retright = right;
                retlen = right - left + 1;
            }
            sum -= arr[left ++];
        }
        right ++;
    }
    cout << retleft << " " << retright << endl;
    return 0;
}